﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Configuration;
using System.Collections.Specialized;

namespace OpelWelcomeScreenWeb.NetUtils.Settings
{
    public class AppConfig
    {
        public static String Get(String key)
        {
            var Settings = WebConfigurationManager.AppSettings;
            return Settings[key];
        }

        public static NameValueCollection GetWebAppSettings()
        {
            return WebConfigurationManager.AppSettings;
        }

        public static NameValueCollection GetCustomSettings(String section)
        {
            return ConfigurationManager.GetSection(section) as NameValueCollection;            
        }

        public static NameValueCollection GetOpelWelcomeSettings(String groupKey)
        {
            var section = String.Format("opelWelcomeScreen/{0}", groupKey);
            return GetCustomSettings(section);
        }
    }
}
